import React from 'react';
import {render} from 'react-dom';
// 引入PC与Mobile响应式
import MediaQuery from 'react-responsive';

import PCIndex from "./adapter/pc/pc_index";
import MobileIndex from "./adapter/mobile/mobile_index";

//路由跳转
import {Router,Route,hashHistory,IndexRoute} from 'react-router';
import Top from "./adapter/pc/pages/top";
import Guoji from "./adapter/pc/pages/guoji";
import Guonei from "./adapter/pc/pages/guonei";
import Yule from "./adapter/pc/pages/yule";
import Shehui from "./adapter/pc/pages/shehui";
import Junshi from "./adapter/pc/pages/junshi";
// 个人中心
import Center from "./adapter/pc/components/center";
//详情页
import NewsDetails from "./adapter/pc/pages/secondpages/newsdetail";
import JunshiDetails from "./adapter/pc/pages/secondpages/junshisecond";

class Index extends React.Component {
  render() {
    return (
      <div>
        <MediaQuery query="(min-device-width: 1224px)">
         {/* PC端 */}
          <Router history={hashHistory}>
          	<Route path='/' component={PCIndex}>
          		<IndexRoute component={Top}></IndexRoute>
          		<Route path='/detail' component={NewsDetails}></Route>
          		<Route path='/junshi' component={Junshi}>
          			<Route path='/junshi/junshidetail' component={JunshiDetails}></Route>
          		</Route>
              <Route path="/guoji" component={Guoji}></Route>
              <Route path="/guonei" component={Guonei}></Route>
              <Route path="/yule" component={Yule}></Route>
              <Route path="/shehui" component={Shehui}></Route>
          	</Route>
          	<Route path='/center'component={Center}></Route>
          </Router>
        </MediaQuery>        
        <MediaQuery query="(max-device-width: 1224px)">
          {/* Mobile端 */}
          <MobileIndex />
        </MediaQuery>
      </div>
    )
  }
}

render(
  <Index/>,
  document.getElementById('root')
)